#!/usr/bin/perl

use strict;
use lib '/var/www/perl/galleri';
use CGI;
use Galleri;
my $g = new Galleri();
my $cgi = new CGI;

my($image_id) = $cgi->param("id");
my($size) = $cgi->param("size");

unless( $size == 1 or $size == 2 or $size == 3 or $size == 4 ){
  die "illegal size class specified";
}

my $image = Galleri::DB->resultset('Images')->find($image_id);

die "image not found\n" unless $image;

$image->show($size);

##$g->show_image($image,$size);
